﻿@{
    Layout = "_Layout_pop_scroll";
}
@section scripts{
    <script type="text/javascript">
        var acceptClick;
        var selectedRow;
        var bootstrap = function ($, ibpm) {
            "use strict";
            var page = {
                init: function () {
                    $("#btn_Search").on('click', function () {
                        page.search();
                    });
                    page.bind();
                },
                bind: function () {
                     $('#gridtree').jfGrid({
                        url: top.$.rootUrl + '/Org/Dept/GetTreeList',
                        headData: [
                            { label: '部门名称', name: 'FullName', width: 240, align: 'left' },
                            { label: '部门编码', name: 'DeptCode', width: 100, align: 'left' },
                            { label: '负责人', name: 'Manager', width: 120, align: 'center' },
                        ],
                        mainId: 'DeptId',
                        parentId: 'ParentId',
                        isTree: true,
                        rows: 9900,
                    });
                    page.search();
                },
                search: function (param) {
                    param = param || {};
                    param.companyId = $('#CurrCompanyID').val();
                    param.keyword = $('#txt_Keyword').val();
                    $('#gridtree').jfGridSet('reload', param);
                }
            };
            acceptClick = function (callBack) {
                selectedRow = $('#gridtree').jfGridGet('rowdata');
                if (!!callBack) {
                    callBack(selectedRow);
                }
                return true;
            };
            page.init();
        }
    </script>
}

<div class="row" style="margin: 5px;">
    <div class="step-pane">
        <div class="btn-tool-bar">
            <div class="btn-group btn-group-sm">
                <input type="hidden" id="CurrCompanyID" value="@ViewBag.ComID" />
                <input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询的关键字" style="width:300px;" />
                <a id="btn_Search" class="btn btn-default" style="line-height:30px;"><i class="fa fa-search"></i>&nbsp;查询</a>
            </div>
        </div>
        <div id="gridtree" style="margin-top:10px;"></div>
    </div>
</div> 